/*
 * ExifToolApp.java
 */
package exiftool;

import exifheader.ImageExif;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

/**
 * The main class of the application.
 */
public class ExifToolApp extends SingleFrameApplication {

    /**
     * At startup create and show the main frame of the application.
     */
    @Override
    protected void startup() {

        /* java.io.File myDir = new java.io.File("\\\\storage1\\photos\\scan\\20-11-09");
        if( myDir.exists() && myDir.isDirectory()){
        java.io.File[] files = myDir.listFiles();
        for(int i=0; i < files.length; i++){
        System.out.println(files[i]);
        }
        try {
        MetadataExample.metadataExample(files[1]);
        } catch (Exception e) {
        System.out.println(e.toString());
        }
        } */

        //java.io.File myPhoto=new java.io.File("c:/scan/20-11-09/DSC_2231.JPG");
/*        java.io.File myDir = new java.io.File("C:/scan/20-11-09");
        if (myDir.exists() && myDir.isDirectory()) {
        java.io.File[] photoFiles =
        myDir.listFiles(new exiftool.resources.photoFileFilter());

        java.util.concurrent.ConcurrentSkipListSet<exifheader.ImageExif> photoList =
        new java.util.concurrent.ConcurrentSkipListSet();
        try {
        for (int i = 0; i < photoFiles.length; i++) {
        //ImageExif myExif = new exifheader.ImageExif(photoFiles[i]);
        photoList.add(new exifheader.ImageExif(photoFiles[i]));
        }
        //myExif.showExif();
        } catch (java.lang.Exception e) {
        }
         */
        // Original code
        //new fileChooser().getFileName();
        //System.out.println(new fileChooser().getFileName());
        show(new ExifToolView(this));
        //}
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override
    protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of ExifToolApp
     */
    public static ExifToolApp getApplication() {
        return Application.getInstance(ExifToolApp.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(ExifToolApp.class, args);
    }
}
